Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow list or string as service type + test cases #82

Merged

Conversation

PatStLouis
Copy link

Addresses #81

@dbluhm Please let me know if anything else needs to be added here!

@dbluhm
Copy link
Member

dbluhm commented Jan 5, 2024

A few failing tests to take care of

@PatStLouis
Copy link
Author

I removed the invalid services I added as they weren't handled properly, I left the valid service using an array.

I was expecting the following types to be rejected but they are not at the moment: True, "", "Some type".

Since this is out of scope for this PR I will leave it as so. Perhaps it would be interesting to consider updating to pydantic 2.0.3+ in the future if there is a need for more strict field validation and introduce field_validators. Field validators would allow to make more interesting validation such as ensuring there is no space in a string, validating the length of an array, etc...

Let me know if this is satisfactory

@dbluhm
Copy link
Member

dbluhm commented Jan 5, 2024

It's possible to do the same with Pydantic 1.x but it would be nice to move to 2.0 regardless. I'm satisfied with these checks for now. Thanks for the contribution!

@dbluhm dbluhm merged commit 0bed560 into Indicio-tech:main Jan 5, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants